﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPlusres.Business.Models
{
    public class CallResult
    {
        /// <summary>
        /// Defalut
        /// </summary>
        public CallResult() 
        {
            this.flag = true;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="msg"></param>
        public CallResult(string msg)
        {
            this.msg = msg;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="data"></param>
        public CallResult(object data)
        {
            this.data = data;
            this.flag = true;
        }

        /// <summary>
        /// Create With Data CallResult
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static CallResult Create(object data)
        {
            return (new CallResult(data));
        }

        /// <summary>
        /// Create With msg CallResult
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static CallResult Create(string msg)
        {
            return (new CallResult(msg));
        }

        /// <summary>
        /// Create a Callresult
        /// </summary>
        /// <returns></returns>
        public static CallResult Create()
        {
            return (new CallResult());
        }

        /// <summary>
        /// Flag
        /// </summary>
        public bool flag { get; set; }

        /// <summary>
        /// Message
        /// </summary>
        public string msg { get; set; }

        /// <summary>
        /// Data
        /// </summary>
        public object data { get; set; }
    }
}
